package com.qiyun.framework.base;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;

import com.qiyun.framework.utils.ToastUtils;


public class BaseActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    protected void showToast(String result){
        ToastUtils.show(this,result);
    }

    protected void showNetWorkErrorToast(){
        showToast("网络错误");
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                finish();
                break;
        }
        return true;
    }

    protected void jumpActivity(Class clz){
        startActivity(new Intent(this,clz));
    }
}
